package com.bw.product.controller;

import com.bw.common.core.domain.Result;
import com.bw.common.core.web.controller.BaseController;
import com.bw.common.core.web.page.TableDataInfo;
import com.bw.common.security.annotation.RequiresPermissions;
import com.bw.product.domain.PmsSkuInfo;
import com.bw.product.service.PmsSkuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * sku信息Controller
 */
@RestController
@RequestMapping("/PmsSkuInfo")
public class PmsSkuInfoController extends BaseController {
    @Autowired
    private PmsSkuInfoService pmsSkuInfoService;


    /**
     * sku列表
     */



    @RequiresPermissions("product:PmsSkuInfo:list")
    @GetMapping("/list")
    public Result list(PmsSkuInfo pmsSkuInfo)
    {
        startPage();
        List<PmsSkuInfo> list = pmsSkuInfoService.selectPmsSkuInfoList(pmsSkuInfo);
        return getDataTable(list);
    }

    /**
    /**
     * 根据skuId获取sku信息详细信息
     */
   @RequiresPermissions("product:PmsSkuInfo:query")
    @GetMapping(value = "/{skuId}")
    public Result<PmsSkuInfo> getInfo(@PathVariable("skuId") Long skuId)
    {
        PmsSkuInfo skuInfo = pmsSkuInfoService.selectPmsSkuInfoBySkuId(skuId);
        return Result.success(skuInfo);
    }





}
